﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IDcard
{
    class Program
    {
        static void Main(string[] args)
        {
            string a;
            bool b = true;
            Console.WriteLine("请输入您的身份证");
            a = Console.ReadLine();
            for (int c = 0; c < a.Length - 1; c++)
            {
                if (a[c] >= '0' && a[c] <= '9')
                {
                    continue;
                }
                else
                {
                    b = false;
                }
            }
            if (a.Length == 18)
            {
                if (b == true)
                {
                    Console.WriteLine("输入正确");
                }
                else if (b == false)
                {
                    Console.WriteLine("输入不合法，请重新输入");
                }
            }
            else
            {
                Console.WriteLine("输入不合法，请重新输入");
            }

            Console.ReadKey();

    }   }
}
